Object.myCreate = function(proto,properties){
    if (typeof proto !== 'object' && typeof proto !== 'function') {
        throw TypeError('Object prototype may only be an Object: ' + proto)
    }
    let newObj = {}
    newObj.__proto__ = proto
    Object.defineProperties(newObj,properties)
    return newObj
}
let obj = Object.myCreate({}, {
    p: {
      value: 42,
      writable: true,
      enumerable: true,
      configurable: true
    }
  })
  console.log(obj);